package com.hspedu.transformation;

import java.io.*;

/**
 * @author 谷其昊
 * @version 1.0
 * @date 2022/2/25
 * @time 15:50
 */
public class InputStreamReader_ {
    public static void main(String[] args) throws FileNotFoundException {
        InputStreamReader inputStreamReader = null;
        BufferedReader bufferedReader = null;
        String line = null;
        try {
            inputStreamReader = new InputStreamReader(new FileInputStream("D:\\BaiduNetdiskDownload\\韩顺平2021基础学Java\\temp\\note2.txt"),"GBK");
            bufferedReader = new BufferedReader(inputStreamReader);

            while ((line = bufferedReader.readLine()) != null){
                System.out.println(line);
            }

        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                bufferedReader.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
